//
// Created by NaSA on 2024/2/12.
// 链表练习
//


#include <iostream>

using namespace std;

int main()
{
    struct Node
    {
        int value;
        Node *next;
    };
    // 将列表转成链表
    int l[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    Node head = {l[0], NULL};
    Node *t = &head;
    for (int i = 1; i < sizeof(l) / 4; ++i)
    {
        t->next = new Node();
        t = t->next;
        t->value = l[i];

    }
//    t->next=NULL;
//    head.value=1;
//    Node node1;
//    head.next=&node1;
//    node1.value=2;
//    Node node2;
//    node1.next=&node2;
//    node2.value=3;
//    node2.next=NULL;
    Node *p = &head;
    while (p != NULL)
    {
        cout << p->value;
        p = p->next;
    }

    return 0;
}